package com.zxl.yjb.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zxl.yjb.R;
import com.zxl.yjb.bean.MyWalletBean;

public class MyWalletListAdapter extends BaseQuickAdapter<MyWalletBean, BaseViewHolder> {

    private final String type;

    public MyWalletListAdapter(int layoutResId, String type) {
        super(layoutResId, null);
        this.type = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, MyWalletBean item) {
        if ("income".equals(type)) {
            helper.setText(R.id.tv_title, item.getTitle());
            helper.setText(R.id.tv_amount, item.getAmount() + "元");
            helper.setText(R.id.tv_time, item.getAddtime());
        }else {
            helper.setText(R.id.tv_title, item.getAlipay_account());
            helper.setText(R.id.tv_amount, item.getAmount() + "元");
            helper.setText(R.id.tv_time, item.getAddtime());
        }

    }

}
